
		**********************************************************
		** File: cleaning_CIA.do								**
		** Paper: Human Trafficking Indicators: A New Dataset	**
		** Author: Richard Frank								**
		** Date: July 11, 2021									**
		** Task: Cleaning CIA FACTBOOK LANGUAGE BREAKDOWN		**
		**********************************************************
 

	** I coded these data into an Excel spreadsheet using the following page:
	** https://www.cia.gov/the-world-factbook/field/languages/
	
	** Email me if you would like me to email you this spreadsheet.
	
		clear all
		version 16.1
		set seed 1234
		cd "~"
		import excel "major languages.xlsx", sheet("Sheet1") firstrow case(lower) clear
		 
		replace english=0 if english==.
		replace spanish=0 if spanish==.
		replace french=0 if french==.
		replace german=0 if german==.
		replace portuguese=0 if portuguese==.
		drop majorlanguage official other
		rename country Country
		run "cow.do"
		sort ccode
		tab Country if ccode==0
		drop if ccode==0
		order Country ccode
		rename Country country
		
		save "major language.dta", replace
